package com.mycode.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mycode.mapper.LoginMapper;
import com.mycode.po.UserinfoPO;
import com.mycode.service.LoginService;
import com.mycode.vo.LoginVO;
import com.mycode.vo.RegistVO;

@Service
public class LoginServiceImpl implements LoginService {

	@Autowired
	private LoginMapper mapper;

	@Override
	public int registUser(RegistVO vo) throws Exception {
		mapper.registNewUser(vo);
		return 1;
	}

	@Override
	public UserinfoPO validateLogin(LoginVO vo) throws Exception {
		return mapper.validateLogin(vo);
	}

	@Override
	public UserinfoPO validateCookieLogin(String userid) throws Exception {
		return mapper.validateCookieLogin(userid);
	}

}
